<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Cheshire-CSG: headers/box.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Cheshire-CSG
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">headers/box.h</div>  </div>
</div>
<div class="contents">
<a href="box_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
<a name="l00013"></a>00013 <span class="preprocessor">#ifndef __Box__</span>
<a name="l00014"></a>00014 <span class="preprocessor"></span><span class="preprocessor">#define __Box__</span>
<a name="l00015"></a>00015 <span class="preprocessor"></span>
<a name="l00016"></a>00016 <span class="preprocessor">#include &quot;<a class="code" href="primitive_8h.html" title="class Primitive header">primitive.h</a>&quot;</span>
<a name="l00017"></a>00017 
<a name="l00025"></a><a class="code" href="class_box.html">00025</a> <span class="keyword">class </span><a class="code" href="class_box.html" title="Box class.">Box</a> : <span class="keyword">public</span> <a class="code" href="class_primitive.html" title="Primitive class.">Primitive</a>
<a name="l00026"></a>00026 {
<a name="l00027"></a>00027         <span class="keyword">protected</span>:
<a name="l00028"></a>00028   
<a name="l00029"></a><a class="code" href="class_box.html#af9c25486a750badb5e746ba616e44bce">00029</a>         <a class="code" href="class_vector.html" title="Vector class.">Vector</a> <a class="code" href="class_box.html#af9c25486a750badb5e746ba616e44bce">a</a>; 
<a name="l00030"></a><a class="code" href="class_box.html#a9ba6812e3bc99ab5faf29f44550b57f5">00030</a>         <a class="code" href="class_vector.html" title="Vector class.">Vector</a> <a class="code" href="class_box.html#a9ba6812e3bc99ab5faf29f44550b57f5">b</a>; 
<a name="l00032"></a>00032         <span class="keyword">public</span>:
<a name="l00033"></a>00033         
<a name="l00034"></a><a class="code" href="class_box.html#ab038c94f04821a9ab0e0313819e5187c">00034</a>         <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">double</span> <a class="code" href="class_box.html#ab038c94f04821a9ab0e0313819e5187c">epsilon</a>;  
<a name="l00037"></a>00037 
<a name="l00038"></a><a class="code" href="class_box.html#aca78d7db44972bfa78d46b7bbc8796f6">00038</a>         <a class="code" href="class_box.html#aca78d7db44972bfa78d46b7bbc8796f6" title="Creates a generic box (empty).">Box</a>() {}
<a name="l00039"></a>00039         <a class="code" href="class_box.html#aca78d7db44972bfa78d46b7bbc8796f6" title="Creates a generic box (empty).">Box</a>(<span class="keyword">const</span> <a class="code" href="class_vector.html" title="Vector class.">Vector</a>&amp;);
<a name="l00040"></a>00040         <a class="code" href="class_box.html#aca78d7db44972bfa78d46b7bbc8796f6" title="Creates a generic box (empty).">Box</a>(<span class="keyword">const</span> <a class="code" href="class_vector.html" title="Vector class.">Vector</a>&amp;, <span class="keyword">const</span> <a class="code" href="class_vector.html" title="Vector class.">Vector</a>&amp;, <span class="keyword">const</span> <a class="code" href="class_vector.html" title="Vector class.">Vector</a>&amp;, <span class="keyword">const</span> <a class="code" href="class_vector.html" title="Vector class.">Vector</a>&amp;, <span class="keywordtype">int</span>);
<a name="l00041"></a>00041         <a class="code" href="class_box.html#aca78d7db44972bfa78d46b7bbc8796f6" title="Creates a generic box (empty).">Box</a>(<span class="keyword">const</span> <a class="code" href="class_vector.html" title="Vector class.">Vector</a>&amp;, <span class="keyword">const</span> <span class="keywordtype">double</span>&amp;);
<a name="l00042"></a>00042         <a class="code" href="class_box.html#aca78d7db44972bfa78d46b7bbc8796f6" title="Creates a generic box (empty).">Box</a>(<a class="code" href="class_vector.html" title="Vector class.">Vector</a>*, <span class="keywordtype">int</span>);
<a name="l00043"></a>00043         <a class="code" href="class_box.html#aca78d7db44972bfa78d46b7bbc8796f6" title="Creates a generic box (empty).">Box</a>(<span class="keyword">const</span> <a class="code" href="class_box.html" title="Box class.">Box</a>&amp;, <span class="keyword">const</span> <a class="code" href="class_box.html" title="Box class.">Box</a>&amp;);
<a name="l00044"></a>00044 
<a name="l00046"></a><a class="code" href="class_box.html#a6a5e09398e85d602a046b429062fb9c2">00046</a>         <a class="code" href="class_box.html#a6a5e09398e85d602a046b429062fb9c2" title="Destroy a box, empty.">~Box</a>() {}
<a name="l00047"></a>00047 
<a name="l00048"></a>00048         <span class="comment">// Access vertexes</span>
<a name="l00049"></a>00049         <a class="code" href="class_vector.html" title="Vector class.">Vector</a>&amp; <a class="code" href="class_box.html#ad41f9a6efac5787613914b12e4c3d11d" title="Returns either end vertex of the box.">operator[]</a>(<span class="keywordtype">int</span>);
<a name="l00050"></a>00050         <a class="code" href="class_vector.html" title="Vector class.">Vector</a> <a class="code" href="class_box.html#ad41f9a6efac5787613914b12e4c3d11d" title="Returns either end vertex of the box.">operator[]</a>(<span class="keywordtype">int</span>) <span class="keyword">const</span>;
<a name="l00051"></a>00051 
<a name="l00052"></a>00052         <a class="code" href="class_vector.html" title="Vector class.">Vector</a> <a class="code" href="class_box.html#a44e2805cb2a7acaaa3937522fae56d23" title="Returns the center of the box.">Center</a>() <span class="keyword">const</span>;
<a name="l00053"></a>00053         <a class="code" href="class_vector.html" title="Vector class.">Vector</a> <a class="code" href="class_box.html#a3e077400dd38d177c39bcc711788eed9" title="Returns the half diagonal of the box.">Diagonal</a>() <span class="keyword">const</span>;
<a name="l00054"></a>00054         <span class="keywordtype">double</span> <a class="code" href="class_box.html#a44dd9300bf9713c9190c3a1e69ef5728" title="Returns the radius of the box, i.e. the length of the half diagonal of the box.">Radius</a>() <span class="keyword">const</span>;
<a name="l00055"></a>00055         <a class="code" href="class_vector.html" title="Vector class.">Vector</a> <a class="code" href="class_box.html#a35f5775304c754981b8a38d141737880" title="Returns the kth vertex of the box.">Vertex</a>(<span class="keywordtype">int</span>) <span class="keyword">const</span>;
<a name="l00056"></a>00056 
<a name="l00057"></a>00057         <span class="keywordtype">double</span> <a class="code" href="class_box.html#a913a6b1487999917a85d87b49b3c1c52" title="Computes the minimum distance between the box and a point in space.">R</a>(<span class="keyword">const</span> <a class="code" href="class_vector.html" title="Vector class.">Vector</a>&amp;) <span class="keyword">const</span>;
<a name="l00058"></a>00058         <a class="code" href="class_vector.html" title="Vector class.">Vector</a> <a class="code" href="class_box.html#a80db61cd35cae3122fe658ac079495ee" title="Computes the normal vector between a point and a box.">Normal</a>(<span class="keyword">const</span> <a class="code" href="class_vector.html" title="Vector class.">Vector</a>&amp;) <span class="keyword">const</span>;
<a name="l00059"></a>00059 
<a name="l00068"></a>00068         <span class="keywordtype">int</span> <a class="code" href="class_box.html#a6ac204afbbdc851645f33df16104292a" title="Intersecting function.">Intersect</a>(<span class="keyword">const</span> <a class="code" href="class_ray.html" title="Ray class.">Ray</a>&amp;, <a class="code" href="class_intersection.html" title="Intersection class.">Intersection</a>&amp;);
<a name="l00069"></a>00069         
<a name="l00079"></a>00079         <span class="keywordtype">int</span> <a class="code" href="class_box.html#a6ac204afbbdc851645f33df16104292a" title="Intersecting function.">Intersect</a>(<span class="keyword">const</span> <a class="code" href="class_ray.html" title="Ray class.">Ray</a>&amp;, <a class="code" href="class_intersection.html" title="Intersection class.">Intersection</a>&amp;, <a class="code" href="class_intersection.html" title="Intersection class.">Intersection</a>&amp;);
<a name="l00080"></a>00080         
<a name="l00090"></a>00090         <span class="keywordtype">int</span> <a class="code" href="class_box.html#a6ac204afbbdc851645f33df16104292a" title="Intersecting function.">Intersect</a>(<span class="keyword">const</span> <a class="code" href="class_ray.html" title="Ray class.">Ray</a>&amp;, <span class="keywordtype">double</span>&amp;, <a class="code" href="class_vector.html" title="Vector class.">Vector</a>&amp;) <span class="keyword">const</span>;
<a name="l00091"></a>00091         <span class="keywordtype">int</span> <a class="code" href="class_box.html#a6ac204afbbdc851645f33df16104292a" title="Intersecting function.">Intersect</a>(<span class="keyword">const</span> <a class="code" href="class_box.html" title="Box class.">Box</a>&amp;) <span class="keyword">const</span>;
<a name="l00092"></a>00092 
<a name="l00100"></a>00100         <span class="keywordtype">int</span> <a class="code" href="class_box.html#abc15073158a80e02f4b1fb32b50e1eb6" title="Containing function.">Inside</a>(<span class="keyword">const</span> <a class="code" href="class_box.html" title="Box class.">Box</a>&amp;) <span class="keyword">const</span>;
<a name="l00101"></a>00101         
<a name="l00109"></a>00109         <span class="keywordtype">int</span> <a class="code" href="class_box.html#abc15073158a80e02f4b1fb32b50e1eb6" title="Containing function.">Inside</a>(<span class="keyword">const</span> <a class="code" href="class_vector.html" title="Vector class.">Vector</a>&amp;) <span class="keyword">const</span>;
<a name="l00110"></a>00110 
<a name="l00118"></a>00118         <span class="keywordtype">int</span> <a class="code" href="class_box.html#afb71788385a4f8ff91c6d8385972dde4" title="Containing function.">PMC</a>(<span class="keyword">const</span> <a class="code" href="class_vector.html" title="Vector class.">Vector</a>&amp;);
<a name="l00119"></a>00119 
<a name="l00120"></a>00120         <span class="keywordtype">double</span> <a class="code" href="class_box.html#ae6092debba95840365b79a02f60d245c" title="Compute the volume of a box.">Volume</a>() <span class="keyword">const</span>;
<a name="l00121"></a>00121         <span class="keywordtype">double</span> <a class="code" href="class_box.html#a8e0a710afacb0bdeb3f751b40ab575b2" title="Compute the surface area of a box.">Area</a>() <span class="keyword">const</span>;
<a name="l00122"></a>00122 
<a name="l00123"></a>00123         <a class="code" href="class_vector.html" title="Vector class.">Vector</a> getPosition() { <span class="keywordflow">return</span> <a class="code" href="class_box.html#a44e2805cb2a7acaaa3937522fae56d23" title="Returns the center of the box.">Center</a>(); };
<a name="l00124"></a>00124         
<a name="l00125"></a>00125 };
<a name="l00126"></a>00126 
<a name="l00128"></a><a class="code" href="class_box.html#ad41f9a6efac5787613914b12e4c3d11d">00128</a> <span class="keyword">inline</span> <a class="code" href="class_vector.html" title="Vector class.">Vector</a>&amp; <a class="code" href="class_box.html#ad41f9a6efac5787613914b12e4c3d11d" title="Returns either end vertex of the box.">Box::operator[] </a>(<span class="keywordtype">int</span> i)
<a name="l00129"></a>00129 {
<a name="l00130"></a>00130         <span class="keywordflow">if</span> (i == 0) <span class="keywordflow">return</span> <a class="code" href="class_box.html#af9c25486a750badb5e746ba616e44bce">a</a>;
<a name="l00131"></a>00131         <span class="keywordflow">else</span> <span class="keywordflow">return</span> <a class="code" href="class_box.html#a9ba6812e3bc99ab5faf29f44550b57f5">b</a>;
<a name="l00132"></a>00132 }
<a name="l00133"></a>00133 
<a name="l00135"></a><a class="code" href="class_box.html#ae638073ba0eb5b6cb7a1f9de3b9a7bd8">00135</a> <span class="keyword">inline</span> <a class="code" href="class_vector.html" title="Vector class.">Vector</a> <a class="code" href="class_box.html#ad41f9a6efac5787613914b12e4c3d11d" title="Returns either end vertex of the box.">Box::operator[] </a>(<span class="keywordtype">int</span> i)<span class="keyword"> const</span>
<a name="l00136"></a>00136 <span class="keyword"></span>{
<a name="l00137"></a>00137         <span class="keywordflow">if</span> (i == 0) <span class="keywordflow">return</span> <a class="code" href="class_box.html#af9c25486a750badb5e746ba616e44bce">a</a>;
<a name="l00138"></a>00138         <span class="keywordflow">else</span> <span class="keywordflow">return</span> <a class="code" href="class_box.html#a9ba6812e3bc99ab5faf29f44550b57f5">b</a>;
<a name="l00139"></a>00139 }
<a name="l00140"></a>00140 
<a name="l00142"></a><a class="code" href="class_box.html#a44e2805cb2a7acaaa3937522fae56d23">00142</a> <span class="keyword">inline</span> <a class="code" href="class_vector.html" title="Vector class.">Vector</a> <a class="code" href="class_box.html#a44e2805cb2a7acaaa3937522fae56d23" title="Returns the center of the box.">Box::Center</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> 0.5 * (<a class="code" href="class_box.html#af9c25486a750badb5e746ba616e44bce">a</a> + <a class="code" href="class_box.html#a9ba6812e3bc99ab5faf29f44550b57f5">b</a>); }
<a name="l00143"></a>00143 
<a name="l00145"></a><a class="code" href="class_box.html#a3e077400dd38d177c39bcc711788eed9">00145</a> <span class="keyword">inline</span> <a class="code" href="class_vector.html" title="Vector class.">Vector</a> <a class="code" href="class_box.html#a3e077400dd38d177c39bcc711788eed9" title="Returns the half diagonal of the box.">Box::Diagonal</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> 0.5 * (<a class="code" href="class_box.html#a9ba6812e3bc99ab5faf29f44550b57f5">b</a> - <a class="code" href="class_box.html#af9c25486a750badb5e746ba616e44bce">a</a>); }
<a name="l00146"></a>00146 
<a name="l00148"></a><a class="code" href="class_box.html#a44dd9300bf9713c9190c3a1e69ef5728">00148</a> <span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="class_box.html#a44dd9300bf9713c9190c3a1e69ef5728" title="Returns the radius of the box, i.e. the length of the half diagonal of the box.">Box::Radius</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> 0.5 * <a class="code" href="vector_8h.html#af90b4e3482e18ba87ba91dac37f85813" title="Compute the Euclidean norm of a vector.">Norm</a>(<a class="code" href="class_box.html#a9ba6812e3bc99ab5faf29f44550b57f5">b</a> - <a class="code" href="class_box.html#af9c25486a750badb5e746ba616e44bce">a</a>); }
<a name="l00149"></a>00149 
<a name="l00151"></a><a class="code" href="class_box.html#a35f5775304c754981b8a38d141737880">00151</a> <span class="keyword">inline</span> <a class="code" href="class_vector.html" title="Vector class.">Vector</a> <a class="code" href="class_box.html#a35f5775304c754981b8a38d141737880" title="Returns the kth vertex of the box.">Box::Vertex</a>(<span class="keywordtype">int</span> k)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="class_vector.html" title="Vector class.">Vector</a>((k&amp;1) ? <a class="code" href="class_box.html#a9ba6812e3bc99ab5faf29f44550b57f5">b</a>[0] : <a class="code" href="class_box.html#af9c25486a750badb5e746ba616e44bce">a</a>[0], (k&amp;2) ? <a class="code" href="class_box.html#a9ba6812e3bc99ab5faf29f44550b57f5">b</a>[1] : a[1], (k&amp;4) ? <a class="code" href="class_box.html#a9ba6812e3bc99ab5faf29f44550b57f5">b</a>[2] : a[2]); }
<a name="l00152"></a>00152 
<a name="l00154"></a><a class="code" href="class_box.html#ae6092debba95840365b79a02f60d245c">00154</a> <span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="class_box.html#ae6092debba95840365b79a02f60d245c" title="Compute the volume of a box.">Box::Volume</a>()<span class="keyword"> const</span>
<a name="l00155"></a>00155 <span class="keyword"></span>{
<a name="l00156"></a>00156         <a class="code" href="class_vector.html" title="Vector class.">Vector</a> side = <a class="code" href="class_box.html#a9ba6812e3bc99ab5faf29f44550b57f5">b</a> - <a class="code" href="class_box.html#af9c25486a750badb5e746ba616e44bce">a</a>;
<a name="l00157"></a>00157         <span class="keywordflow">return</span> side[0] * side[1] * side[2];
<a name="l00158"></a>00158 }
<a name="l00159"></a>00159 
<a name="l00161"></a><a class="code" href="class_box.html#a8e0a710afacb0bdeb3f751b40ab575b2">00161</a> <span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="class_box.html#a8e0a710afacb0bdeb3f751b40ab575b2" title="Compute the surface area of a box.">Box::Area</a>()<span class="keyword"> const</span>
<a name="l00162"></a>00162 <span class="keyword"></span>{
<a name="l00163"></a>00163         <a class="code" href="class_vector.html" title="Vector class.">Vector</a> side = <a class="code" href="class_box.html#a9ba6812e3bc99ab5faf29f44550b57f5">b</a> - <a class="code" href="class_box.html#af9c25486a750badb5e746ba616e44bce">a</a>;
<a name="l00164"></a>00164         <span class="keywordflow">return</span> 2.0 * (side[0] * side[1] + side[0] * side[2] + side[1] * side[2]);
<a name="l00165"></a>00165 }
<a name="l00166"></a>00166 
<a name="l00168"></a><a class="code" href="class_box.html#a913a6b1487999917a85d87b49b3c1c52">00168</a> <span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="class_box.html#a913a6b1487999917a85d87b49b3c1c52" title="Computes the minimum distance between the box and a point in space.">Box::R</a>(<span class="keyword">const</span> <a class="code" href="class_vector.html" title="Vector class.">Vector</a>&amp; p)<span class="keyword"> const</span>
<a name="l00169"></a>00169 <span class="keyword"></span>{
<a name="l00170"></a>00170         <span class="keywordtype">double</span> r = 0.0;
<a name="l00171"></a>00171 
<a name="l00172"></a>00172         <span class="comment">// Slab</span>
<a name="l00173"></a>00173         <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0; i &lt; 3; i++)
<a name="l00174"></a>00174         {
<a name="l00175"></a>00175                 <span class="keywordflow">if</span>(p[i] &lt; <a class="code" href="class_box.html#af9c25486a750badb5e746ba616e44bce">a</a>[i])
<a name="l00176"></a>00176                 {
<a name="l00177"></a>00177                         <span class="keywordtype">double</span> s = p[i] - <a class="code" href="class_box.html#af9c25486a750badb5e746ba616e44bce">a</a>[i];
<a name="l00178"></a>00178                         r += s * s;
<a name="l00179"></a>00179                 }
<a name="l00180"></a>00180                 <span class="keywordflow">else</span> <span class="keywordflow">if</span>(p[i] &gt; <a class="code" href="class_box.html#a9ba6812e3bc99ab5faf29f44550b57f5">b</a>[i])
<a name="l00181"></a>00181                 {
<a name="l00182"></a>00182                     <span class="keywordtype">double</span> s = p[i] - <a class="code" href="class_box.html#a9ba6812e3bc99ab5faf29f44550b57f5">b</a>[i];
<a name="l00183"></a>00183                     r += s * s;
<a name="l00184"></a>00184                 }
<a name="l00185"></a>00185         }
<a name="l00186"></a>00186         <span class="keywordflow">return</span> r;
<a name="l00187"></a>00187 }
<a name="l00188"></a>00188 
<a name="l00190"></a><a class="code" href="class_box.html#a80db61cd35cae3122fe658ac079495ee">00190</a> <span class="keyword">inline</span> <a class="code" href="class_vector.html" title="Vector class.">Vector</a> <a class="code" href="class_box.html#a80db61cd35cae3122fe658ac079495ee" title="Computes the normal vector between a point and a box.">Box::Normal</a>(<span class="keyword">const</span> <a class="code" href="class_vector.html" title="Vector class.">Vector</a>&amp; p)<span class="keyword"> const</span>
<a name="l00191"></a>00191 <span class="keyword"></span>{
<a name="l00192"></a>00192         <a class="code" href="class_vector.html" title="Vector class.">Vector</a> n;
<a name="l00193"></a>00193 
<a name="l00194"></a>00194         <span class="comment">// Slab</span>
<a name="l00195"></a>00195         <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0; i &lt; 3; i++)
<a name="l00196"></a>00196         {
<a name="l00197"></a>00197                 <span class="keywordflow">if</span>(p[i] &lt; <a class="code" href="class_box.html#af9c25486a750badb5e746ba616e44bce">a</a>[i]) n[i] = p[i] - <a class="code" href="class_box.html#af9c25486a750badb5e746ba616e44bce">a</a>[i];
<a name="l00198"></a>00198                 <span class="keywordflow">else</span> <span class="keywordflow">if</span>(p[i]&gt;<a class="code" href="class_box.html#a9ba6812e3bc99ab5faf29f44550b57f5">b</a>[i]) n[i] = p[i] - <a class="code" href="class_box.html#a9ba6812e3bc99ab5faf29f44550b57f5">b</a>[i];
<a name="l00199"></a>00199                 <span class="keywordflow">else</span> n[i] = 0.0;
<a name="l00200"></a>00200         }
<a name="l00201"></a>00201         <span class="keywordflow">return</span> n;
<a name="l00202"></a>00202 }
<a name="l00203"></a>00203 
<a name="l00204"></a>00204 <span class="preprocessor">#endif</span>
<a name="l00205"></a>00205 <span class="preprocessor"></span>
</pre></div></div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Friends</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Sun Oct 2 2011 17:01:12 for Cheshire-CSG by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
